<?php

namespace app\index\validate;

use think\Validate;

class SendOrder extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
        'orderNum'      => ['require'],
        'express'       => ['require'],
        'sender_info'   => ['require'],
        'receiver_info' => ['require'],
        'send_way'      => ['require', 'integer']
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'orderNum'          => '订单号不能为空',
        'express.require'   => '邮寄类型不能为空',
        'sender_info.require' => '寄件地址不能为空',
        'receiver_info.require' => '收件地址不能为空',
        'send_way.require'  => '寄件方式不能为空',
        'send_way.integer'  => '参数类型错误',
    ];
}
